<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/WEB-INF/views/system/taglibs.jsp" %>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<div id="toolbar">
    <form id="list" action="getData">
        <div id="search" class="easyui-panel" title="查询条件" data-options="fit:true,collapsible:true,border:0">
            <table class="searchTable">
                <tr>
                    <td>标题：</td>
                    <td><input type="text" id="title" name="nameLike"></td>
                    <td>状态：</td>
                    <td>
                        <select name="isHot">
                            <option value="">请选择...</option>
                            <option value="1">热门</option>
                            <option value="0">非热门</option>
                        </select>
                    </td>
                    <td>创建时间：</td>
                    <td><input id="createTimeStart" name="createTimeStart" type="datetime" class="easyui-datebox"/>
                        至 <input id="createTimeEnd" name="createTimeEnd" type="datetime" class="easyui-datebox"/>
                    </td>
                    <td>
                        <button id="queryBtn" type="button" class="button">查询</button>
                    </td>
                    <td>
                        <button id="clearBtn" type="button" class="button">清空</button>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <div class="operate">
        <div class="om-panel-header">活动类型列表</div>
        <div class="icon">
            <ul>
                <li>
                    <a href="#" onclick="showAdd('/activity/type/toAdd',1000,650);">
                        <span class="menu1"></span>添加
                    </a>
                </li>
                <li>
                    <a href="#" onclick="showEdit('/activity/type/edit','id',1000,650);">
                        <span class="menu13"></span>编辑
                    </a>
                </li>
                <li>
                    <a href="#" onclick="removeRow('id');">
                        <span class="menu11"></span>删除
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
<table id="grid" data-options="fit:true,border:false"></table>
</body>
<script type="text/javascript">
    $(function () {
        $('#grid').datagrid({
            url: 'getData',
            pageSize: 15,
            pageList: [15, 30, 40, 50, 100, 200, 300, 400, 500, 1000],
            striped: true,
            rownumbers: true,
            pagination: true,
            singleSelect: false,
            toolbar: '#toolbar',
            nowrap: false,
            rowStyler: function (index, row) {
                if (row.isHot) {
                    return 'background-color:#ffd9d9;';
                }
            },
            columns: [
                [
                    {field: 'ck', checkbox: true},
                    {title: '标题', field: 'name', sortable: "true"},
                    {title: '发布日期', field: 'createTime', sortable: "true"},
                    {title: '说明', field: 'intro', sortable: "true"},
                    {
                        title: '是否热门', field: 'isHot', sortable: "true",
                        formatter: function (v, r) {
                            return v ? "热门" : "非热门"
                        }
                    }
                ]
            ]
        });
    });
</script>
</html>